@model AccountProfileEditModel
@{
  Layout = "layouts/_profile.cshtml";
}
@inject IStringLocalizer<Resource> _localizer

@section HeaderScript{
  <title>@_localizer["account-profile"]</title>
}

@section FooterScript {
  <script src="~/_content/@ThemesStandardConstant.AssemblyName/js/profile.js"></script>
}

<h1 class="section-title">@_localizer["account-profile"]</h1>
<div class="section-content -half">
  @if (!string.IsNullOrEmpty(Model.Error))
  {
    <div class="account-message -error">@Model.Error</div>
  }
  <form method="post" asp-controller="account" asp-action="profile">
    <input type="hidden" asp-for="RedirectUri" />
    <input type="hidden" asp-for="IsProfile" />
    <input type="hidden" asp-for="Avatar" />
    <div class="form-item">
      <label class="form-label mb-1">@_localizer["avatar"]</label>
      <div class="d-flex">
        <img src="@PageHelper.CheckGetAvatarUrl(Model.Avatar)" width="39" height="39" class="profilePicture rounded me-3" alt="@Model.NickName" />
        <button class="btn btn-link" onclick="return fileManager.uploadClick('@UploadType.Avatar');" type="button" title="@_localizer["upload"]" data-bs-toggle="tooltip">
          <svg width="18" height="18" class="bi bi-arrow-up-circle">
            <use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#bi-arrow-up-circle"></use>
          </svg>
        </button>
        <button class="btn btn-link" type="button" title="@_localizer["reset"]" data-bs-toggle="tooltip">
          <svg width="18" height="18" class="bi bi-x-circle">
            <use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#bi-x-circle"></use>
          </svg>
        </button>
      </div>
    </div>
    <div class="form-item">
      <label for="profileNickName" class="form-label">@_localizer["user-name"]</label>
      <input id="profileNickName" class="form-control" type="text" asp-for="NickName" />
      <span asp-validation-for="NickName"></span>
    </div>
    <div class="form-item">
      <label for="profileEmail" class="form-label">@_localizer["email"]</label>
      <input id="profileEmail" class="form-control" type="email" asp-for="Email" />
      <span asp-validation-for="Email"></span>
    </div>
    <div class="form-item">
      <label for="profileBio" class="form-label">@_localizer["user-bio"]</label>
      <textarea id="profileBio" class="form-control" rows="4" asp-for="Bio"></textarea>
      <span asp-validation-for="Bio"></span>
    </div>
    <div class="form-item">
      <button type="submit" class="btn btn-blogifier px-5">@_localizer["save"]</button>
    </div>
  </form>
</div>
